home *** CD-ROM | disk | FTP | other *** search
- Path: transfer.stratus.com!usenet
- From: "David L. McReynolds" <David_McReynolds@vos.stratus.com>
- Newsgroups: comp.lang.c
- Subject: Re: Question on argv
- Date: 1 Feb 1996 05:56:40 GMT
- Organization: S2 Systems, Inc.
- Message-ID: <4epkmo$231@transfer.stratus.com>
- References: <4eoq3c$45j@usenet.ucs.indiana.edu>
- NNTP-Posting-Host: enclave.ssi.stratus.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
- gompa@nickel.ucs.indiana.edu (Raghu R. Gompa) wrote:
- >I am writing a program in which I want to
- >retrieve the arguments argv[1] ... argv[4].
- >argv[1] .. argv[3] are strings of characters.
- >I want to use argv[4] as an integer. Can
- >I do that? and how? Thank you for your
- >help in advance. .. Raghu
-
-
- --
- argv is an array of pointers to arrays of chars. Therefore
- you will have to do something like
-
- int my_int_argv4;
-
- my_int_argv4 = atoi(argv[4]);
-
- the prototype for atoi is: int atoi(const char*);
- ______________________________________________________________________________
- David L. McReynolds All statements are my own and
- Software Engineer I are in no way reflective of
- S2 Systems, Inc. the ideas or attitudes of
- 600 Embassy Row, Suite 300 S2 Systems, Inc.
- Atlanta, GA 30328-1670 USA
- email: David_McReynolds@vos.stratus.com
- fax: (770)551-2550
-
-
-